#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''   校验函数库  '''


import re


#   邮箱校验
def is_email(my_str):
    reg = r'^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$'
    return re.match(reg, my_str)


#   空校验
def is_empty(data):
    if (data is None) or (isinstance(data, str) and data.strip() == ''):
        return True
    else:
        return False


if __name__ == '__main__':
    print is_empty(0)

